<div ng-init="init()">
  <form class="form-horizontal" role="form" novalidate name="myForm">
    <div class="form-ctrl md-whiteframe-z1">
      <div class="form-search" style="height:280px;" ng-class="{true: 'shou'}[shoumun.num==0]" ng-switch
           on="sendData.timeType">
        <div>
          <label style="width:70px">业务系统</label>
          <md-select ng-model="sendData.system" >
            <md-option ng-value="sys.systemCode" ng-repeat="sys in systems" ng-click="queryBusinessName(sys.systemCode)">{{sys.systemName}}</md-option>
          </md-select>
        </div>
        <div>
          <label style="width:70px">业务名称</label>
          <md-select multiple ng-model="sendData.business">
            <md-select-label>
              {{sendData.business.length ? _getNames(sendData.business,'businessName',contents) :'全部'}}
            </md-select-label>
            <md-option ng-value="" ng-click="_checkAll(sendData,'business')">全部</md-option>
            <md-option ng-value="cont" ng-repeat="cont in contents" ng-click="chooseBusChanel(cont)">{{cont.businessName}}</md-option>
          </md-select>
        </div>
         <div>
          <label style="width:90px">业务渠道</label>
          <md-select multiple ng-model="sendData.channel" disabled ng-if="!showChannel">
          <md-select-label>全部</md-select-label>
          </md-select>
          <md-select multiple ng-model="sendData.channel" ng-if="showChannel">
            <md-select-label>
              {{sendData.channel.length ? _getNames(sendData.channel,'channelName',businessLine) :'全部'}}
            </md-select-label>
            <md-option ng-value="" ng-click="_checkAll(sendData,'channel')">全部</md-option>
            <md-option ng-value="bl" ng-repeat="bl in channels">{{bl.channelName}}</md-option>
          </md-select>
        </div>
        <div></div>
        <div></div>
        <div>
          <label style="">时间粒度{{timeTypes.timeTypes}}</label>
          <md-select ng-model="sendData.timeType" placeholder="日">
            <md-option ng-value="item.timeTypeCode" ng-repeat="item in timeTypes" >{{item.timeTypeName}}</md-option>
          </md-select>
        </div>
        <div ng-switch-when="1">
          <md-input-container flex>
            <label>开始时间</label>
            <input type="date" ng-model="sendData.startTime"  time-validate="day" end-time="sendData.endTime" required
                   name="startDate">
            <div ng-messages="myForm.startDate.$error">
              <div ng-message="date">请正确输入时间</div>
              <div ng-message="time-error">开始时间不应大于结束时间</div>
              <div ng-message="too-great">结束时间不应大于当前时间</div>
            </div>
          </md-input-container>
        </div>
        <div ng-switch-when="1">
          <md-input-container flex>
            <label>结束时间</label>
            <input type="date" ng-model="sendData.endTime"  time-validate="day" start-time="sendData.startTime" required
                   name="endDate">
            <div ng-messages="myForm.endDate.$error">
              <div ng-message="date">请正确输入时间</div>
              <div ng-message="time-error">开始时间不应大于结束时间</div>
              <div ng-message="too-great">结束时间不应大于当前时间</div>
            </div>
          </md-input-container>
        </div>
        <div ng-switch-when="3">
          <md-input-container flex>
            <label>开始时间</label>
            <input type="month" ng-model="sendData.startTime"  time-validate="month" end-time="sendData.endTime" required
                   name="startMonth">
            <div ng-messages="myForm.startMonth.$error">
              <div ng-message="date">请正确输入时间</div>
              <div ng-message="time-error">开始时间不应大于结束时间</div>
              <div ng-message="too-great">结束时间不应大于当前时间</div>
            </div>
          </md-input-container>
        </div>
        <div ng-switch-when="3">
          <md-input-container flex>
            <label>结束时间</label>
            <input type="month" ng-model="sendData.endTime"  time-validate="month" start-time="sendData.startTime"
                   required name="endMonth">
            <div ng-messages="myForm.endMonth.$error">
              <div ng-message="date">请正确输入时间</div>
              <div ng-message="time-error">开始时间不应大于结束时间</div>
              <div ng-message="too-great">结束时间不应大于当前时间</div>
            </div>
          </md-input-container>
        </div>
      </div> <i class="glyphicon glyphicon-chevron-up shrinkage" ng-show="!btnDisabled" ng-click="shoumun.num=0"></i>
      <md-button ng-disabled="myForm.$invalid"  ng-click="shoumun.num==1?shoumun.num=0:shoumun.num=1;search()" class="md-fab md-primary md-hue-1" aria-label="Profile"> <i class="glyphicon glyphicon-arrow-down"
      style="margin-top:28px;"  ng-show="shoumun.num==0"></i>
        <i class="glyphicon glyphicon-search" ng-show="shoumun.num==1"></i>
      </md-button>
    </div>
  </form>
  <div class="table-info">
    <div class="menus" ng-show="flag === 'view'">
      <md-button class="md-raised" ng-click="search()" style="background-color: #FF9800;color:white">问题数</md-button>
      <md-button class="md-raised" ng-click="busContrast()" style="background-color: #FF9800;color:white">业务问题数对比</md-button>
      <md-button class="md-raised" ng-click="channelContrast()" style="background-color: #FF9800;color:white" >渠道问题数对比</md-button>
    </div>
    <div>
      <div id="doc" style="height:450px;padding: 15px;"></div>
    </div>
  </div>
</div>